import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store/index'

Vue.config.productionTip = false

// 全局样式
import '@/styles/index.scss';
import '@/assets/iconfont/iconfont.css'

// 滑动验证插件(内置图片跨域)
import SlideVerify from 'vue-monoplasty-slide-verify';
Vue.use(SlideVerify);

// 引入动画
import animated from 'animate.css';
Vue.use(animated);

// 引入ViewUI组件
import ViewUI from '@/commont/plugins/viewUI';
import 'view-design/dist/styles/iview.css';
Vue.use(ViewUI);

// 引入ElementUI组件
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

//  引入Echarts：想要引入中国地图，版本不能高于5.0
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts;
require('echarts/map/js/china.js');
require('echarts/map/js/world.js');

// 引入jQuery
// import $ from 'jquery'

// 引用bootstrap
// import 'bootstrap/dist/css/bootstrap.min.css'
// import 'bootstrap/dist/js/bootstrap.min.js'


// 引入富文本框
import VueQuillEditor from 'vue-quill-editor';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
Vue.use(VueQuillEditor);

// js工具类(时间戳转换，数组去重，浏览器信息的获取等.....)
import jutils from 'jutils-src';
Vue.use(jutils);

// 运行mock
require('./mock/index');

// 字体自适应
import { setSize } from '@/commont/utils/setSize';
window.onresize = () => {
  // setSize();
}

// 将公共方法挂在到vue原型链上
import util from '@/commont/utils/index'
Vue.prototype.$util = util;

// 自动锁屏引入
// import Astrict from '@/commont/utils/astrict';
// Vue.use(Astrict);

Date.prototype.format = function (fmt) {
  var o = {
    "M+": this.getMonth() + 1,               //月份
    "d+": this.getDate(),                    //日
    "h+": this.getHours(),                   //小时
    "m+": this.getMinutes(),                 //分
    "s+": this.getSeconds(),                 //秒
    "q+": Math.floor((this.getMonth() + 3) / 3), //季度
    "S": this.getMilliseconds()             //毫秒
  };
  if (/(y+)/.test(fmt)) {
    fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  }
  for (var k in o) {
    if (new RegExp("(" + k + ")").test(fmt)) {
      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    }
  }
  return fmt;
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
